package com.example.reademe.interrupt;

/**
 * @author shishaopeng
 * Date: 2023-10-07-14-26
 * Desc:
 */
public class InterruptTask extends Thread {

    @Override
    public void run() {
        while (true) {
            if (this.isInterrupted()) {
                System.out.println(Thread.currentThread().getName() + ":线程中止了");
                break;
            }
            System.out.println(Thread.currentThread().getName() + "：运行");
        }
    }

}
